Feat: Support Recipe Parameters in Goose desktop app#3155
Merged
angiejones merged 16 commits intoblock:mainfrom Jul 2, 2025
Merged
Feat: Support Recipe Parameters in Goose desktop app#3155angiejones merged 16 commits intoblock:mainfrom
angiejones merged 16 commits intoblock:mainfrom
Conversation
AaronGoldsmith
commented
Jun 30, 2025
Comment on lines
80
to
83
| // Escape special characters in the key (parameter) and match optional whitespace | ||
| const regex = new RegExp(`{{\\s*${key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*}}`, 'g'); | ||
| const beforeSubstitution = substitutedPrompt; | ||
| substitutedPrompt = substitutedPrompt.replace(regex, params[key]); |
Contributor
Author
There was a problem hiding this comment.
Treat the parameter as literal text, to avoid regex injection and unintended matching.
For example, without santization
// matches {{user_name}}, {{user-name}}, etc
substitutedPrompt.replace(new RegExp('{{user.name}}'), value) with sanitization
// matches exactly {{user.name}}
substitutedPrompt.replace(new RegExp('{{user\.name}}'), value)…rompt' and remove unused options in ParameterInput refactor: simplify onClose handler in ParameterInputModal and clean up styling comments
…ges and avoid duplicates
* main: return missign npx/uvx (block#3148) docs: add more instructions about resuming a session for cli users (block#3146)
katzdave
reviewed
Jun 30, 2025
|
|
||
| // Log each substitution for debugging | ||
| if (beforeSubstitution !== substitutedPrompt) { | ||
| console.log(`Replaced {{${key}}} with "${params[key]}"`); |
| } | ||
| } | ||
|
|
||
| console.log('Final substituted prompt:', substitutedPrompt); |
|
|
||
| // Log each substitution for debugging | ||
| if (beforeSubstitution !== substitutedText) { | ||
| console.log(`Replaced {{${key}}} with "${params[key]}" in instructions`); |
katzdave
approved these changes
Jul 1, 2025
Collaborator
katzdave
left a comment
There was a problem hiding this comment.
Took another look + tested some more with recipes with various types of params. I think looks good.
angiejones
reviewed
Jul 2, 2025
|
|
||
| // Create and send the user message | ||
| const userMessage = createUserMessage(recipeConfig.prompt); | ||
| console.log('Auto-sending substituted prompt for scheduled execution:', finalPrompt); |
angiejones
reviewed
Jul 2, 2025
| console.log('Final config extensions:', config.extensions); | ||
|
|
||
| const yamlString = serializeParametersToYAML(parameters); | ||
| console.log('Serialized Parameters to YAML:', yamlString); |
angiejones
reviewed
Jul 2, 2025
| const originalInstructions = (recipeConfig as { instructions?: string })?.instructions; | ||
|
|
||
| if (!originalInstructions) { | ||
| console.log('No instructions to substitute parameters in'); |
angiejones
reviewed
Jul 2, 2025
|
|
||
| if (!response.ok) { | ||
| console.warn(`Failed to update system prompt with parameters: ${response.statusText}`); | ||
| } else { |
Collaborator
There was a problem hiding this comment.
can remove the else clause?
AaronGoldsmith
commented
Jul 2, 2025
.github/workflows/build-cli.yml
Outdated
Comment on lines
287
to
291
|
|
||
| # Move the built binary to the expected location (inside container) | ||
| mkdir -p ../target/x86_64-pc-windows-gnu/release | ||
| mv temporal-service.exe ../target/x86_64-pc-windows-gnu/release/temporal-service.exe | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Gah, sorry – I have automatic linting on, and it linted all the changed files from the merge. Let me know if I should revert the whitespace issues.
* main: (37 commits) fix: fix desktop recipe url generation (block#3209) feat: improve UX for saving recipes (block#3214) fix: Pass Google AI API key in HTTP header, not query param (block#3192) docs: add linter to CONTRIBUTING.md (block#3168) feat: Structured output for recipes (block#3188) Fix cost tracking accuracy and OpenRouter model pricing (block#3189) docs: update cli install instructions for windows (block#3205) Docs: Cost tracking on the desktop app (block#3204) feat: Adding streamable-http transport support for backend, desktop and cli (block#2942) fix: use the correct `contains` syntax on create-recipe-pr.yml (block#3193) Temporarily Remove GH Copilot Provider (block#3199) docs: fix tab navigation (block#3201) feat: use tiktoken-rs instead of tokenizers, single global tokenizer (block#3115) add playwright-mcp server to extensions list (block#3010) Add `/extension` path for extension installation (block#3011) feat(desktop): Prioritize suffix when truncating path in header (block#3110) chore(release): release version 1.0.31 (block#3185) feat: additional sub recipes via command line (block#3163) Add Internal Recipes To Recipes Cookbook (block#3179) pipe the argument to storage (block#3184) ...
Contributor
Author
|
I'm going to need to force push to reset the branch back to a healthy state. I'll re-request reviews |
6ad0a3a to
e314a58
Compare
wpfleger96
added a commit
to wpfleger96/goose
that referenced
this pull request
Jul 2, 2025
* main: Defend against invalid sessions (block#3229) Clean up session file optionality for --no-session (block#3230) Feat: Support Recipe Parameters in Goose desktop app (block#3155) docs: update recipe example (block#3222) Add native OAuth 2.0 authentication support to MCP client (block#3213) build: Check in Cargo.lock changes (block#3220) fix: fix desktop recipe url generation (block#3209) feat: improve UX for saving recipes (block#3214)
baxen
added a commit
to Developerayo/goose
that referenced
this pull request
Jul 2, 2025
* main: (150 commits) Defend against invalid sessions (block#3229) Clean up session file optionality for --no-session (block#3230) Feat: Support Recipe Parameters in Goose desktop app (block#3155) docs: update recipe example (block#3222) Add native OAuth 2.0 authentication support to MCP client (block#3213) build: Check in Cargo.lock changes (block#3220) fix: fix desktop recipe url generation (block#3209) feat: improve UX for saving recipes (block#3214) fix: Pass Google AI API key in HTTP header, not query param (block#3192) docs: add linter to CONTRIBUTING.md (block#3168) feat: Structured output for recipes (block#3188) Fix cost tracking accuracy and OpenRouter model pricing (block#3189) docs: update cli install instructions for windows (block#3205) Docs: Cost tracking on the desktop app (block#3204) feat: Adding streamable-http transport support for backend, desktop and cli (block#2942) fix: use the correct `contains` syntax on create-recipe-pr.yml (block#3193) Temporarily Remove GH Copilot Provider (block#3199) docs: fix tab navigation (block#3201) feat: use tiktoken-rs instead of tokenizers, single global tokenizer (block#3115) add playwright-mcp server to extensions list (block#3010) ...
jsibbison-square
added a commit
that referenced
this pull request
Jul 2, 2025
…x-turns * origin/main: Defend against invalid sessions (#3229) Clean up session file optionality for --no-session (#3230) Feat: Support Recipe Parameters in Goose desktop app (#3155) docs: update recipe example (#3222) Add native OAuth 2.0 authentication support to MCP client (#3213) build: Check in Cargo.lock changes (#3220) fix: fix desktop recipe url generation (#3209) feat: improve UX for saving recipes (#3214) fix: Pass Google AI API key in HTTP header, not query param (#3192) docs: add linter to CONTRIBUTING.md (#3168)
atarantino
pushed a commit
to atarantino/goose
that referenced
this pull request
Jul 14, 2025
Signed-off-by: Adam Tarantino <tarantino.adam@gmail.com>
s-soroosh
pushed a commit
to s-soroosh/goose
that referenced
this pull request
Jul 18, 2025
Signed-off-by: Soroosh <soroosh.sarabadani@gmail.com>
kwsantiago
pushed a commit
to kwsantiago/goose
that referenced
this pull request
Jul 19, 2025
Signed-off-by: Kyle Santiago <kyle@privkey.io>
cbruyndoncx
pushed a commit
to cbruyndoncx/goose
that referenced
this pull request
Jul 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces enhancements to support recipe parameters in the desktop UI, including parameter substitution, validation, and serialization. The changes span multiple files, adding functionality for parameter handling in recipes, improving user interaction, and enabling serialization of parameters to YAML format.
✨ What's New
Recipe Parameters - Transform your recipes into flexible, reusable templates with dynamic parameter substitution! 🎯
This PR introduces a powerful new parameter system that allows recipes to accept user input at runtime, making them adaptable to different projects, environments, and use cases.
🚀 Key Features
🔧 Parameter Definition
{{parameter_name}}placeholders in instructions and prompts🎨 Interactive Parameter Collection
⚡ Dynamic Substitution
🎁 User Experience Enhancements
🔧 Technical Implementation
Core Components
Parameter Flow
🎨 UI/UX Features
🔧 Development Notes
Force Push Required: Local git hooks were automatically running linting and including formatting changes in merge commits. A force push was necessary to maintain clean commit history and separate linting changes from feature implementation.
✅ Testing
📁 Files Changed
ui/desktop/src/types/recipe/index.ts- Parameter interface definitionsui/desktop/src/components/ParameterInputModal.tsx- Parameter collection UIui/desktop/src/components/RecipeEditor.tsx- Recipe parameter integrationui/desktop/src/main.ts- Parameter substitution and chat window creationui/desktop/src/utils/parameterSubstitution.ts- Template processing engineResult: Recipes are now powerful, reusable templates that adapt to any context. Users can create once and reuse everywhere with personalized parameter values! 🎉